fix: omit temperature for Claude models that reject it - #39
Open
ehammond wants to merge 2 commits into
Open
Conversation
Newer Claude models (Opus 4.7+, Sonnet 5, Fable 5) removed the temperature parameter and return a 400 for any value, breaking every request made with the default claude-opus-4-8 model. Make temperature opt-in: only send it when the user explicitly configures one. Also update the stale default model to claude-opus-4-8. [Created with AI: Claude Code with Opus 4.8] Claude-Session: https://claude.ai/code/session_011AkFCoUHqunn97PjiJKK8R
[Created with AI: Claude Code with Opus 4.8] Claude-Session: https://claude.ai/code/session_011AkFCoUHqunn97PjiJKK8R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running any
abccommand with the defaultclaude-opus-4-8model failed:Newer Claude models (Opus 4.7+, Sonnet 5, Fable 5) removed the
temperatureparameter and return a 400 for any value, including the default0.0. The Anthropic provider hardcodedtemperature=self.temperatureinto every request, so every call broke.Fix
temperatureopt-in in the Anthropic provider: only include it in the request when the user explicitly sets one in their config. Omitted otherwise, which works on all current models while still supporting older models for anyone who configures it.claude-opus-4-5toclaude-opus-4-8.2026.07.15.Testing
temperaturedefaults toNone; added coverage that it's omitted by default and sent when configured.abc_generate "print hello"now returns a command instead of the 400.[Created with AI: Claude Code with Opus 4.8]
https://claude.ai/code/session_011AkFCoUHqunn97PjiJKK8R